package com.edu.exam.enums.curriculum.questionbank;

/**
 * 规则状态枚举
 * 
 * 验证规则的状态定义
 * 
 * @author System
 * @version 1.0.0
 */
public enum RuleStatus {
    ACTIVE("ACTIVE", "启用"),
    INACTIVE("INACTIVE", "停用"),
    DEPRECATED("DEPRECATED", "已废弃");

    private final String code;
    private final String description;

    RuleStatus(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static RuleStatus fromCode(String code) {
        for (RuleStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return ACTIVE;
    }
}